package com.leo;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import org.kordamp.bootstrapfx.scene.layout.Panel;

/**
 * @ClassName ButtonDemo
 * @Description
 * @Author wangss
 * @date 2020.11.26 20:15
 * @Version 1.0
 */
public class ButtonDemo extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {

        Panel panel = new Panel("This is the title");
        panel.getStyleClass().add("panel-primary");
        BorderPane content = new BorderPane();
        content.setPadding(new Insets(20));
        Button button = new Button("Hello BootstrapFX");
        button.getStyleClass().setAll("btn", "btn-danger");
        Button button1 = new Button("Hello BootstrapFX warn");
        button1.getStyleClass().setAll("btn", "btn-warning");
        Button button2 = new Button("Hello BootstrapFX info");
        button2.getStyleClass().setAll("btn", "btn-xs", "btn-info");
        Button button3 = new Button("Hello BootstrapFX success");
        button3.getStyleClass().setAll("btn", "btn-lg", "btn-success");
        content.setCenter(button);
        content.setLeft(button1);
        content.setRight(button2);
        content.setBottom(button3);
        panel.setBody(content);

        Scene scene = new Scene(panel);
        scene.getStylesheets().add("org/kordamp/bootstrapfx/bootstrapfx.css");

        primaryStage.setTitle("BootstrapFX");
        primaryStage.setScene(scene);
        primaryStage.setWidth(800d);
        primaryStage.setHeight(650d);
//        primaryStage.sizeToScene();
        primaryStage.show();
    }
}
